home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / scanchar.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.7 KB  |  71 lines

  1. /* Copyright (C) 1990, 1995, 1996 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: scanchar.h,v 1.2 2000/09/19 19:00:48 lpd Exp $ */
  20. /* Definitions for token scanner character type table */
  21. /* Requires scommon.h */
  22.  
  23. #ifndef scanchar_INCLUDED
  24. #  define scanchar_INCLUDED
  25.  
  26. /*
  27.  * An array for fast scanning of names, numbers, and hex strings.
  28.  * Indexed by character code (including exceptions), it contains:
  29.  *      0 - max_radix-1 for valid digits,
  30.  *      ctype_name for other characters valid in names,
  31.  *      ctype_btoken for characters introducing binary tokens
  32.  *        (if the binary token feature is enabled),
  33.  *      ctype_space for whitespace characters,
  34.  *      ctype_exception for exceptions (see scommon.h), and
  35.  *      ctype_other for everything else.
  36.  * Exceptions are negative values; we bias the table origin accordingly.
  37.  *
  38.  * NOTE: This table is defined in iscantab.c and used in a variety of places.
  39.  * If any of the values below change, you must edit the table.
  40.  */
  41. extern const byte scan_char_array[max_stream_exception + 256];
  42.  
  43. #define scan_char_decoder (&scan_char_array[max_stream_exception])
  44. #define min_radix 2
  45. #define max_radix 36
  46. #define ctype_name 100
  47. #define ctype_btoken 101
  48. #define ctype_space 102
  49. #define ctype_other 103
  50. #define ctype_exception 104
  51. /* Special characters with no \xxx representation */
  52. #define char_NULL 0
  53. #define char_EOT 004        /* ^D, job delimiter */
  54. #define char_VT 013        /* ^K, vertical tab */
  55. #define char_DOS_EOF 032    /* ^Z */
  56. /*
  57.  * Most systems define '\n' as 0x0a and '\r' as 0x0d; however, OS-9
  58.  * has '\n' = '\r' = 0x0d and '\l' = 0x0a.  To deal with this,
  59.  * we introduce abstract characters char_CR and char_EOL such that
  60.  * any of [char_CR], [char_CR char_EOL], or [char_EOL] is recognized
  61.  * as an end-of-line sequence.
  62.  */
  63. #define char_CR '\r'
  64. #if '\r' == '\n'
  65. #  define char_EOL 0x0a        /* non-OS-9 compilers complain about '\l' */
  66. #else
  67. #  define char_EOL '\n'
  68. #endif
  69.  
  70. #endif /* scanchar_INCLUDED */
  71.